ThispaperpresentsDiet-Mate,apersonalized,data- driven nutritional recommendation system designed to optimize daily caloric intake and meal planning. Traditional dietary applications often rely on generalized guidelines, failing to account for individual physiological nuances and dynamic user inquiries.Theproposedsystemintegratesfundamentalmetabolic calculations, including Body Mass Index (BMI) and Total Daily EnergyExpenditure(TDEE),withaK-NearestNeighbors(KNN) machinelearningalgorithmtodynamicallygenerateuser-specific meal configurations for breakfast, lunch, and dinner. Further- more, the architecture incorporates a conversational artificial intelligenceagent,poweredbythePerplexityAPI,toprovidereal- time, context-aware nutritional guidance. Preliminary system evaluations indicate a 94% caloric adherence rate between rec- ommended meals and target energy expenditure, with meal gen- eration latency averaging under 150 milliseconds. These results demonstrate that Diet-Mate offers a highly responsive, accurate, and interactive solution for modern dietary management.
Introduction
Diet-Mate is an intelligent web-based diet recommendation system that combines machine learning, physiological health calculations, and conversational AI to provide personalized nutrition planning. Unlike traditional diet-tracking applications that rely on static calorie charts and manual logging, Diet-Mate dynamically generates customized meal plans based on individual characteristics such as age, gender, height, weight, physical activity level, and health goals. The system calculates Body Mass Index (BMI), Basal Metabolic Rate (BMR) using the Mifflin-St Jeor equation, and Total Daily Energy Expenditure (TDEE) to determine each user's daily caloric requirements. A K-Nearest Neighbors (KNN) algorithm then recommends suitable food items from a nutritional database, while an AI-powered chatbot integrated through the Perplexity API provides real-time dietary guidance and answers users' nutrition-related questions.
The proposed framework follows a modular architecture consisting of user profiling, metabolic calculations, machine learning-based meal recommendation, and a conversational AI layer. User biometric information is processed through physiological equations to estimate daily calorie needs, after which a standardized food dataset containing calorie values, macronutrients, meal categories, and food images is searched using the KNN algorithm. Feature normalization ensures balanced consideration of calories, carbohydrates, proteins, and fats during recommendation. The selected food items are organized into balanced breakfast, lunch, and dinner plans, while the conversational interface enables users to request alternative meals, nutritional breakdowns, or general health advice in real time.
The system is implemented using Python, Flask, SQLAlchemy, scikit-learn, Pandas, and NumPy, with HTML, CSS, and JavaScript for the frontend. User information is stored in a relational database, and communication with the Perplexity API is managed through RESTful requests. The hardware requirements are modest, requiring a standard computer with at least an Intel Core i5 processor, 8 GB RAM, and 256 GB storage, making the platform practical for both local deployment and cloud hosting.
Experimental evaluation demonstrates that Diet-Mate performs efficiently and accurately. The KNN recommendation engine achieved approximately 94% caloric adherence, generating meal plans that remain within a 5% margin of the user's target TDEE. Backend computations, including BMI, BMR, and KNN-based recommendations, required less than 150 milliseconds per request, while the conversational AI responded in approximately 1.2 seconds, ensuring smooth real-time interaction. Usability testing also confirmed stable session management, accurate meal image rendering, and an intuitive user interface, making Diet-Mate a reliable and engaging personalized nutrition assistant for everyday health management.
Conclusion
The proposed diet recommendation system successfully demonstratestheintegrationofmetabolicmodeling,structured nutritional data, and machine-learning techniques to generate personalized meal plans for users. By combining BMI and BMRcalculationswithactivity-adjustedcaloricestimation,the systemensuresthatdietaryrecommendationsaregrounded in established nutritional principles. The incorporation of a similarity-based KNN model further enhances the system’s adaptability,allowingittoproducemealsuggestionsthatalign with individual caloric requirements and nutritional needs.The web-based implementation, supported by a structureduserinterfaceandasecurebackend,providesaseamless user experience by simplifying data entry, visualization, and interpretation. The experimental results confirm the reliability, consis- tency, and responsiveness of the system across diverse user profiles. The generated outputs were nutritionally coherentand aligned with expected meal patterns, while performance metrics demonstrated low computational overhead and real- timeresponsecapability.Thesefindingsvalidatethefeasibility of using lightweight machine-learning models combined with metabolic science to support personalized nutrition planning. Overall, the system establishes a practical and scalable foun- dation for automated dietary recommendation, contributing to thebroaderdomainofdigitalhealth andpersonalizedwellness technologies.
References
[1] World Health Organization, “Body Mass Index (BMI) Classification,”WHO Global Database on Body Mass Index, 2024.
[2] M. D. Mifflin, S. T. St Jeor, L. A. Hill, B. J. Scott, S. A. Daugherty, and Y.O.Koh,“Anewpredictiveequationforrestingenergyexpenditureinhealthy individuals,” The American Journal of Clinical Nutrition, vol.51, no. 2, pp. 241–247, 1990.
[3] T.CoverandP.Hart,“NearestNeighborPatternClassification,”IEEETransactions on Information Theory, vol. 13, no. 1, pp. 21–27, 1967.
[4] PalletsProjects,“FlaskWebFrameworkDocumentation,”2024.[On-line]. Available: https://flask.palletsprojects.com/.
[5] SQLAlchemy Project, “SQLAlchemy Documentation,” 2024. [Online].Available: https://www.sqlalchemy.org/.
[6] scikit-learnDevelopers,“Scikit-learn:MachineLearninginPython,”2024. [Online]. Available: https://scikit-learn.org/.
[7] W.McKinney,“DataStructuresforStatisticalComputinginPython,”Proceedingsofthe9thPythoninScienceConference,2010.
[8] S.vanderWalt,S.C.Colbert,andG.Varoquaux,“TheNumPyArray:AStructure for Efficient Numerical Computation,” Computing in Science& Engineering, vol. 13, no. 2, pp. 22–30, 2011.
[9] Python Software Foundation, “Python Language Reference,” 2024.[Online]. Available: https://www.python.org/.
[10] J.Ordovas,J.Ferguson,andS.Tai,“PersonalizedNutritionandHealth,”BMJ,vol.361,pp.225–232,2018.
[11] A. Albawi, A. Mohammed, and S. Al-Zawi, “Machine Learning Tech-niques for Personalized Diet Recommendation Systems: A Review,”Journal of Healthcare Engineering, vol. 2020, Article ID 4871543.
[12] USDA FoodData Central, “Food and Nutrient Database for DietaryStudies,” 2024. [Online]. Available: https://fdc.nal.usda.gov/.
[13] Harvard School of Public Health, “Healthy Eating Plate and Caloric Distribution Guidelines,” 2024.
[14] N. Elmqvist and A. Moere, “Designing User Interfaces for Data-Driven Health Applications,” IEEE Computer Graphics and Applications, 2019.
[15] A. Laranjo et al., “Conversational agents in healthcare: a systematic review,” Journal of the American Medical Informatics Association, vol. 25, no. 9, pp. 1248–1258, 2018.